package com.nf.test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class 测试类 {
    public static void main(String[] args) {

        //1.先拿到一个spring容器
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        //2.拿1台电脑
        电脑I computer = (电脑I) context.getBean("computer");
        computer.打印文本("hello 140");

        /*
        电脑I computer = (电脑I) context.getBean("computer");
        打印机I printer = (打印机I)context.getBean("printer");

        System.out.println(computer);
        System.out.println(printer);
        computer.玩游戏();
        computer.打印文本("hello 140");
        */

    }
}
